﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Streaming_Service.Media {
    using System.Runtime.Serialization;

    using Streaming_Service.Enum;

    [DataContract]
    public class MovieSearchEntry {
        // The data to use for searching
        [DataMember]
        public MovieEntry MovieEntry { get; set; }

        // The user id of the user searching, 0 = guest
        [DataMember]
        public int UserID { get; set; }

        // Whether or not all specified fields must match
        [DataMember]
        public bool AllMustMatch { get; set; }

        // Whether or not the title in the movie entry is a partial title
        [DataMember]
        public bool TitleIsPartial { get; set; }

        // The difference in years the year of the movie can differ
        [DataMember]
        public int YearDifference { get; set; }

        // The direction(s) it can differ
        [DataMember]
        public DifferenceDirection YearDifferenceDirection { get; set; }

        // The difference in minutes the length of the movie can differ
        [DataMember]
        public int LengthDifference { get; set; }

        // The direction(s) it can differ
        [DataMember]
        public DifferenceDirection LengthDifferenceDirection { get; set; }

        // How specific the release date search should be
        [DataMember]
        public DateSpecification ReleaseDateSpecification { get; set; }

        // Avoid saving the search in history
        [DataMember]
        public bool DoNotSaveToSearchHistory { get; set; }

        public MovieSearchEntry() {
            MovieEntry = new MovieEntry();
            UserID = 0;
            AllMustMatch = true;
            TitleIsPartial = false;
            YearDifference = 0;
            YearDifferenceDirection = DifferenceDirection.Both;
            LengthDifference = 0;
            LengthDifferenceDirection = DifferenceDirection.Both;
            ReleaseDateSpecification = DateSpecification.Complete;
            DoNotSaveToSearchHistory = false;
        }
    }
}